home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODFDev / ODF / OS / FWGraphx / FWShLiSh.h < prev    next >
Encoding:
Text File  |  1996-09-17  |  3.6 KB  |  137 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FWShpLst.h
  4. //    Release Version:    $ ODF 2 $
  5. //
  6. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef FWSHLISH_H
  11. #define FWSHLISH_H
  12.  
  13. // ----- Foundation Includes -----
  14.  
  15. #ifndef FWEXCLIB_H
  16. #include "FWExcLib.h"
  17. #endif
  18.  
  19. // ----- OS Includes
  20.  
  21. #ifndef FWSHAPE_H
  22. #include "FWShape.h"
  23. #endif
  24.  
  25. #ifndef FWSHPLST_H
  26. #include "FWShpLst.h"
  27. #endif
  28.  
  29. // ----- OpenDoc Includes -----
  30.  
  31. #ifndef FWODTYPS_H
  32. #include "FWODTyps.h"
  33. #endif
  34.  
  35. //========================================================================================
  36. //    Forward Declarations
  37. //========================================================================================
  38.  
  39. class    FW_CGraphicContext;
  40. class    FW_CPoint;
  41. class    FW_CRect;
  42. class    FW_CShape;
  43.  
  44. //========================================================================================
  45. //    class FW_CShapeListShape
  46. //========================================================================================
  47.  
  48. class    FW_CShapeListShape : public FW_CShape
  49. {
  50.  
  51. public:
  52.     FW_DECLARE_CLASS
  53.     FW_DECLARE_AUTO(FW_CShapeListShape)
  54.  
  55. //----------------------------------------------------------------------------------------
  56. //    Constructors/Destructors
  57. //
  58. public:
  59.                                 FW_CShapeListShape(const FW_PShapeList& list);
  60.                                 FW_CShapeListShape(const FW_CShapeListShape& other);
  61.                                 FW_CShapeListShape(FW_CReadableStream& stream);
  62.  
  63.     virtual                    ~FW_CShapeListShape();
  64.  
  65. //----------------------------------------------------------------------------------------
  66. //    Operators
  67. //
  68. public:
  69.     FW_CShapeListShape&            operator=(const FW_CShapeListShape& other);
  70.  
  71. //----------------------------------------------------------------------------------------
  72. //    New API
  73. //
  74.  
  75.     // ----- Shape list methods
  76.  
  77.     const FW_PShapeList&        GetShapeList() const;
  78.     FW_PShapeList&                GetShapeList();
  79.  
  80.     FW_PShapeList&                GetUnSharedShapeList();
  81.  
  82.     void                        SetShapeList(const FW_PShapeList& list);
  83.  
  84.     FW_CShape*                    HitTestList(FW_CGraphicContext& gc,
  85.                                              const FW_CPoint& test,
  86.                                              FW_Fixed tolerance) const;
  87.     
  88. //----------------------------------------------------------------------------------------
  89. //    Shape API
  90. //
  91. public:
  92.     // ----- Memory Management
  93.     virtual void                Purge();
  94.  
  95.     // ----- Rendering
  96.     virtual void                 Render(FW_CGraphicContext& gc) const;
  97.     static  void                RenderShapeList(FW_CGraphicContext& gc,
  98.                                                 const FW_PShapeList& shapeList);
  99.     
  100.     // ----- Copying
  101.     virtual FW_CShape*            Copy() const;
  102.     FW_CShapeListShape*            DeepCopy() const;
  103.  
  104.     // ----- Hit Testing
  105.     virtual FW_Boolean            HitTest(FW_CGraphicContext& gc,
  106.                                     const FW_CPoint& test,
  107.                                     FW_Fixed tolerance) const;
  108.     // ----- Transform
  109.     virtual void                Transform(Environment *ev, ODTransform* transform);
  110.     virtual void                InverseTransform(Environment *ev, ODTransform* transform);
  111.  
  112.     virtual void                MoveShape(FW_Fixed deltaX, FW_Fixed deltaY);
  113.     virtual void                MoveShapeTo(FW_Fixed x, FW_Fixed y);
  114.     
  115.     virtual void                Inset(FW_Fixed h, FW_Fixed v);
  116.     
  117.     // ----- Bounds
  118.     virtual void                 GetBounds(FW_CGraphicContext& gc, FW_CRect& rect) const;
  119.     
  120.     // ----- Anchor Point -----
  121.     virtual FW_CPoint            GetAnchorPoint() const;
  122.     
  123.     // ----- Archiving -----
  124.     virtual void                Flatten(FW_CWritableStream& stream) const;
  125.     static void*                 Read(FW_CReadableStream& stream, FW_ClassTypeConstant type);
  126.  
  127. //----------------------------------------------------------------------------------------
  128. //    Implementation
  129. //
  130.  
  131. private:
  132.     FW_PShapeList                fShapeList;
  133. };
  134.  
  135.  
  136. #endif // FWSHLISH_H
  137.